package com.nvr.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @author wjwei
 */
@Component
public class ApplicationStateEventPublisher {

    @Autowired
    private ApplicationEventPublisher publisher;

    public void publish(Order source) {
        ApplicationStateEvent stateEvent = new ApplicationStateEvent(source, source.getStatus());
        publisher.publishEvent(stateEvent);
    }
}
